package day19;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;


/**
 *  测试自己的缓冲读取流
 * @author wangbiao
 *
 */
public class CustomBufferedReaderDemo {

	
	public static void main(String[] args) {

		CustomBufferedReader cbr = null;
		
		try {
			cbr = new CustomBufferedReader(new FileReader("D:\\MyProject\\javatest\\src\\day19\\CustomBufferedReader.java"));
			String line = null;
			while ((line = cbr.readLine()) != null) {
				System.out.println(line);
			}
		} catch (FileNotFoundException e) {
			throw new RuntimeException("系统文件未找到！");
		} catch (IOException e) {
			throw new RuntimeException("文件读取失败！");
		} finally {
			if (null != cbr) {
				try {
					cbr.close();
				} catch (IOException e) {
					throw new RuntimeException("读取缓冲流关闭失败！");
				}
			}
		}
	}

}
